import React from "react";
import styles from "./index.module.less";
import MDEditor from "@uiw/react-md-editor";

const isMobile = /Android|webOS|iPhone|iPod|BlackBerry/i.test(
    navigator.userAgent
);

const MdRenderer = (props) => {
    const { source } = props;
    return (
        <div className={isMobile ? styles.m_md_renderer : styles.md_renderer}>
            <MDEditor.Markdown
                source={source}
                style={{ fontSize: isMobile && "0.3rem" }}
            />
        </div>
    );
};

export default MdRenderer;
